﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.ObjectBuilder2;

namespace Lilium.Unity.ContainerConfiguration
{
	public class ContainerConfigurationStrategy : BuilderStrategy
	{
		public override void PreBuildUp(IBuilderContext context)
		{
			if (context == null) throw new ArgumentNullException("context");

			base.PreBuildUp(context);

			var policy = context.Policies.Get<IContainerConfigurationPolicy>(context.BuildKey);
			if (policy != null)
				policy.ConfigureInjection(context);
		}
	}
}
